<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Cat(name,age){
            this.name = name
            //拥有age
            Animal.call(this,age)
        }
        Cat.prototype = Animal.prototype
        Cat.prototype.constructor = Cat
        function Animal(age){
            this.age = age
        }
        Animal.prototype.eat = function(){
            console.log(this.name +'chi')
        }
        var p = new Cat('lisi',18)
        console.log(p)
        p.eat()
        console.log( Cat.prototype.constructor === Cat)
    </script>
</body>
</html>